//
//  UIView+GetImage.m
//  xpkc
//
//  Created by TopSageOSX on 15/3/6.
//  Copyright (c) 2015年 TopSage. All rights reserved.
//

#import "UIView+GetImage.h"

@implementation UIView (GetImage)

- (UIImage *)getImage{
    UIGraphicsBeginImageContext(self.bounds.size);
    UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, self.layer.contentsScale);
    [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

@end
